import asyncio

async def g(n):
    for i in range(n):
        yield i

async def f(generator, count):
    async for item in generator(count):
        print(item,end=',')

asyncio.run(f(g, 5))
